const utils = {
  toast: (title = '加载中...') => {
    wx.showToast({
      title,
      icon: 'none',
      mask: true
    })
  },
  formatTime: (time) => {
    const date = new Date(time)
    const YYYY = date.getFullYear()
    const MM = date.getMonth() + 1
    const DD = date.getDate()
    const arr = new Array(YYYY, MM, DD)
    return arr.map(ele => (ele < 10 ? '0' + ele : ele)).join('-')
  }
}
wx.utils = utils
export default utils